package com.nbsaas.boot.project.data.entity;

import com.nbsaas.boot.code.annotation.FieldConvert;
import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import com.nbsaas.boot.jpa.data.entity.User;
import com.nbsaas.boot.project.api.domain.enums.ProjectMemberType;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.Data;

@FormAnnotation(title = "任务参与人", model = "任务参与人")
@Data
@Entity
@Table(name = "nb_project_task_member")
public class ProjectTaskMember extends AbstractEntity {


    /**
     * 任务
     */
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private ProjectTask task;

    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private User user;

    /**
     * 成员类型
     */
    private ProjectMemberType memberType;


}
